package com.nyt.report.constant;

import com.nyt.report.util.StringUtils;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class CityCodes {

    public static Boolean exist(String stationcode, String standardcode) {
        String value = citys.get(stationcode);
        if (!StringUtils.isBlank(value) && !StringUtils.isBlank(standardcode) && standardcode.startsWith(value)){
            return true;
        }
        else {
            return false;
        }
    }

    public static Set<String> keySet() {
        return citys.keySet();
    }

    private static Map<String, String> citys = null;

    static {
        citys = new HashMap(){{
            put("A", "4401");
            put("F", "4402");
            put("B", "4403");
            put("C", "4404");
            put("D", "4405");
            put("E", "4406");
            put("J", "4407");
            put("G", "4408");
            put("K", "4409");
            put("H", "4412");
            put("L", "4413");
            put("M", "4414");
            put("N", "4415");
            put("P", "4416");
            put("Q", "4417");
            put("R", "4418");
            put("S", "4419");
            put("T", "4420");
            put("U", "4451");
            put("V", "4452");
            put("W", "4453");
        }};
    }
}
